package com.hncu.studentTest;

public class Student {
    private String name;
    private int age;

    public Student() {

    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public void setAge(int age) {
        if (age < 0 || age > 120) {
            System.out.println("输入年龄有误！");
        } else {
            this.age = age;
        }
    }

    public int getAge() {
        return this.age;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return this.name;
    }

    public void show() {
        System.out.println(this.name + "..." + this.age);
    }
}
